package com.slz3.business.module.systemManagement.sysFunction.steward;

import com.slz3.business.frame.response.RR;
import com.slz3.business.frame.response.ResInfo;
import com.slz3.business.module.systemManagement.sysFunction.domain.SysFunction;
import com.slz3.business.module.systemManagement.sysFunction.domain.SysFunctionCondition;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

public class SysFunctionResController {

    static Mono<ServerResponse> add(ServerRequest req, SysFunction sysFunction) {
        if (SysFunctionResUnsafeValid.add(req, sysFunction)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return SysFunctionResAtomic.add_$SysFunctionUpdateLock(req, sysFunction);
        }
    }

    static final Mono<ServerResponse> delete(ServerRequest req, SysFunctionCondition sysFunctionCondition) {
        if (SysFunctionResUnsafeValid.delete(req, sysFunctionCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return SysFunctionResAtomic.delete_$SysFunctionUpdateLock(req, sysFunctionCondition);
        }
    }

    static Mono<ServerResponse> modify(ServerRequest req, SysFunction sysFunction) {
        if (SysFunctionResUnsafeValid.modify(req, sysFunction)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return SysFunctionResAtomic.modify_$SysFunctionUpdateLock(req, sysFunction);
        }
    }

    static Mono<ServerResponse> list(ServerRequest req) {
        if (SysFunctionResUnsafeValid.list(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return SysFunctionResExecutor.list(req);
        }
    }

    static Mono<ServerResponse> info(ServerRequest req) {
        if (SysFunctionResUnsafeValid.info(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return SysFunctionResAtomic.info_$SysFunctionUpdateLock(req);
        }
    }

    static Mono<ServerResponse> choice(ServerRequest req) {
        if (SysFunctionResUnsafeValid.choice(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return SysFunctionResExecutor.choice(req);
        }
    }

    static final Mono<ServerResponse> auditSubmit(ServerRequest req, SysFunctionCondition sysFunctionCondition) {
        //
        if (SysFunctionResUnsafeValid.auditSubmit(req, sysFunctionCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return SysFunctionResAtomic.auditSubmit_$SysFunctionUpdateLock(req, sysFunctionCondition);
        }
    }

    static final Mono<ServerResponse> audit(ServerRequest req, SysFunctionCondition sysFunctionCondition) {
        if (SysFunctionResUnsafeValid.audit(req, sysFunctionCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return SysFunctionResAtomic.audit_$SysFunctionUpdateLock(req, sysFunctionCondition);
        }
    }

    static final Mono<ServerResponse> auditReject(ServerRequest req, SysFunctionCondition sysFunctionCondition) {
        if (SysFunctionResUnsafeValid.auditReject(req, sysFunctionCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return SysFunctionResAtomic.auditReject_$SysFunctionUpdateLock(req, sysFunctionCondition);
        }
    }

    static final Mono<ServerResponse> usingEnable(ServerRequest req, SysFunctionCondition sysFunctionCondition) {
        if (SysFunctionResUnsafeValid.usingEnable(req, sysFunctionCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return SysFunctionResAtomic.usingEnable_$SysFunctionUpdateLock(req, sysFunctionCondition);
        }
    }

    static final Mono<ServerResponse> usingDisable(ServerRequest req, SysFunctionCondition sysFunctionCondition) {
        if (SysFunctionResUnsafeValid.usingDisable(req, sysFunctionCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return SysFunctionResAtomic.usingDisable_$SysFunctionUpdateLock(req, sysFunctionCondition);
        }
    }

}
